<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 

class MY_Form_validation extends CI_Form_validation 
{

	public function __construct($rules = array())
	{
		parent::__construct($rules);
		$this->CI->lang->load('MY_form_validation');
	}
	
	function datechecker($date_from_input)
	{
		//Date From Input must be m/d/Y

		$CI =& get_instance();

		$post = $CI->input->post('username');

		$d[0] = $post['month'];
		$d[1] = $post['day'];
		$d[2] = $post['year'];

		$_f_date = implode('/',$d);

		$dates = DateTime::createFromFormat('m/d/Y',$_f_date);

		if($dates !== FALSE)
		{
			if($dates AND checkdate($d[0],$d[1],$d[2]))
			{
				return TRUE;
			}else{
				return FALSE;
			}
		}else{
			return FALSE;
		}
	}
 }
?>